<?php

/**
 * form format for radio buttons class.
 *
 *
 * @package    clockportal
 * @subpackage form
 * @author     Clockportal team
 * 
 * 
 */
class sfWidgetFormSchemaFormatterEmbbedContainer extends sfWidgetFormSchemaFormatter
{

    protected $requiredFields = array();

    public function setRequiredFields(array $requiredFields = array())
    {
        $this->requiredFields = $requiredFields;
    }

    protected
    $required = '<span>*</span>',
    $rowFormat = '<li class="row">
                    <div class="input">%field%%error%</div>
                  </li>',
    $helpFormat = '<div class="hint">%help%</div>',
    $errorRowFormatInARow = '<div class="msgBox error">%error%</div>',
    $errorRowFormat = '%errors%',
    $namedErrorRowFormatInARow = "<li><b>%name%:</b> %error%</li>\n",
    $errorListFormatInARow = '<ul class="error_list">%errors%</ul>',
    $decoratorFormat = '<ul>%content%</ul>'

    ;

    public function generateLabel($name, $attributes = array())
    {
        $label = parent::generateLabel($name, $attributes);
        if(array_search($name, $this->requiredFields) !== false)
            $label .= $this->required;

        return $label;
    }

}